package org.itboys.seller.service;

import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseService;
import org.itboys.seller.entity.SellerBank;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2016/6/13.
 */
@Service
public class SellerBankService extends BaseService<SellerBank, Long> {

    @Resource(name="adminDS")
    private MongoDataSource ds;

    @Override
    protected MongoDataSource getMongoDataSource() {
        return ds;
    }

    @Override
    protected Class<SellerBank> getEntityClass() {
        return SellerBank.class;
    }

    public List<SellerBank> getAllSources() {
        return ds.createQuery(getEntityClass()).asList();
    }
}
